if (inweo.get("inweo.widgets.expander") != true) {
	inweo.set("inweo.widgets.expander", true);
	inweo.widgets.expander = inweo.core.widget.extend({
		initialize: function() {
			var self = this;
			this.widget = new Element("div");
			this.widget.addClass("expander");
			this.widget.addClass("expandTrue");
			this.widget.setProperty("expand", true);
			
			this.expanderBar = new Element("div");
			this.expanderBar.addClass("expanderBar");
			this.expanderBar.injectInside(this.widget);
			
			this.expanderEvent = new inweo.core.event(this.expanderBar);
			this.expanderEvent.addEvent("click", function() {
				bool = self.widget.getProperty("expand").toString();
				if (bool == "true") {
					self.expanded(false);
				} else if (bool == "false") {
					self.expanded(true);
				}
			});
			
			this.image = new Element("img");
			this.image.setProperty("src", inweo.get("path") + "skin/images/transparent.png");
			this.image.injectInside(this.expanderBar);
			
			this.label = new Element("span");
			this.label.injectInside(this.expanderBar);

			this.content = new Element("div");
			this.content.addClass("expanderContent");
			this.content.injectInside(this.widget);
		},
		image: function(src) {
			if (src != null) {
				this.image.setProperty("src", src);
			} else {
				return this.image.getProperty("src");
			}
		},
		expanded: function(bool) {
			if (bool == true) {
				this.widget.removeClass("expandFalse");
				this.widget.addClass("expandTrue");
				this.content.setStyle("display", "block");
				this.widget.setProperty("expand", "true");
			} else if (bool == false) {
				this.widget.addClass("expandFalse");
				this.widget.removeClass("expandTrue");
				this.content.setStyle("display", "none");
				this.widget.setProperty("expand", "false");
			} else {
				return this.widget.getProperty("expand");
			}
		},
		text: function(string) {
			if (string != null) {
				this.label.setText(string);
			} else {
				return this.label.getText();
			}
		},
		pack: function(child) {
			child.__pack(this.content);
		}
	});
	inweo.widgets.expander.tag = inweo.core.tag.extend({
		initialize: function() {
			inweo.loadCss(inweo.get("path") + "widgets/expander/expander.css");
		},
		insert: function(element, obj) {
			obj.content.setHTML(element.innerHTML);
			this.parent(element, obj);
		}
	});
}